<template>
  <el-dropdown @command="changeLanguage">
    <span class="el-dropdown-link">
      <svg-icon style="color:#fff;font-size:20px" icon-class="language" />
    </span>
    <el-dropdown-menu slot="dropdown">
      <el-dropdown-item command="zh" :disabled="$i18n.locale === 'zh'">中文</el-dropdown-item>
      <el-dropdown-item command="en" :disabled="$i18n.locale === 'en'">EngLish</el-dropdown-item>
    </el-dropdown-menu>
  </el-dropdown>
</template>

<script>
export default {
  name: 'Lang',
  methods: {
    changeLanguage(command) {
      console.log(command)
      console.log(this.$i18n)
      this.$i18n.locale = command
      this.$message.success('语言切换成功')
    }
  }
}
</script>

<style lang="less" scoped>

</style>>

